from flask import request
from flask import Flask
app = Flask(__name__)

@app.route('/')
def home():
    return 'Hello, 尤里卡!'
    
@app.route('/greet')
def greet():
    name = request.args.get('name', 'Guest')
    return f'Hello, {name}!'
    
@app.route('/api', methods=['POST'])
def api():
    # 接收JSON数据
    data = request.json
    name = data.get('name')
    return {'status': 'success', 'name':name}
    
if __name__ == '__main__':
    app.run(debug=True, port=5003, host='0.0.0.0')
